class Solution {
public:
    Solution() {
        ios::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    }
    int findRepeatNumber(vector<int>& nums) {
        vector<int> againarr(nums.size(), 0);
        for (const auto& num : nums)
            againarr[num]++;
        int i = 0;
        for (i = 0; i < nums.size(); ++i)
        {
            if (againarr[i] >= 2)
                break;
        }
        return i;
    }
};